package com.huilian.iotbox.admin.dao;

import com.huilian.iotbox.data.dto.MemberStoreBalanceDto;
import com.huilian.iotbox.data.po.Member;
import com.huilian.iotbox.data.po.MemberStoreBalance;
import com.huilian.iotbox.data.vo.MemberStoreBalanceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MemberStoreBalanceDao {

    List<Member> consumeMember(MemberStoreBalance memberStoreBalance);

    MemberStoreBalanceVo findMemberStoreBalanceByMerchantStoreId(MemberStoreBalanceDto memberStoreBalanceDto);

    Integer updateMemberStoreBalance(MemberStoreBalance memberStoreBalance);

    Integer findDayMemberNewNumByStoreId(MemberStoreBalanceDto memberStoreBalanceDto);

    void insert(MemberStoreBalance memberStoreBalance);

    MemberStoreBalance findOneMemberStoreBalanceById(long memberStoreBalanceId);

    int addMemberStoreBalance(@Param("rechargeNum") int rechargeNum, @Param("donateNum") int donateNum, @Param("memberStoreBalanceId") long memberStoreBalanceId, @Param("memberId") long memberId, @Param("userId") int userId, @Param("merchantStoreId") int merchantStoreId, @Param("versionId") Integer versionId);

    int reduceMemberStoreBalance(int rechargeNum, int donateNum, Long memberStoreBalanceId, Long memberId, Integer userId, Integer merchantStoreId, Integer versionId);

    int addMemberStoreChargeBalance(MemberStoreBalance memberStoreBalance);

    Integer findDayMemberOldNumByStoreId(MemberStoreBalanceDto memberStoreBalanceDto);

    /**
     * 修改用户场地的积分
     */
    Integer updateMemberStoreBalanceIntegral(MemberStoreBalanceDto memberStoreBalanceDto);
}
